#ifndef RECENTFILESVIEW_H
#define RECENTFILESVIEW_H

#include <QObject>
class RecentFiles;
class RecentFilesViewObserver;

class RecentFilesView
{
public:
    RecentFilesView(RecentFiles& model);
    virtual ~RecentFilesView();

    /**
      * Informs registered observers of the view that a new most recent file
      * has been selected.
      * // TODO: Shouldn't this be protected?
      * @param filename The name of the new most recent file.
      */
    void recentFileSelected(const QString& filename);
    void registerObserver(RecentFilesViewObserver* observer);
    void unRegisterObserver(RecentFilesViewObserver* observer);

    /**
      * Update this view with the contents of the model.
      */
    virtual void update() = 0;

protected:
    /** The model displayed by this view. */
    RecentFiles& m_model;

    /** A list of observers interested in events emitted from RecentFilesView objects. */
    QList<RecentFilesViewObserver*> m_observers;
};

#endif // RECENTFILESVIEW_H
